﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String path = request.getContextPath();
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="stylesheet" type="text/css" href="<%=path%>/backstatic/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/backstatic/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/backstatic/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/backstatic/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="<%=path%>/backstatic/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="<%=path%>/backstatic/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>用户管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span> 用户管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<ul>
			<li style="float: left;margin-left: 5px;"><span>审核状态：</span></li>
			<li style="float: left;margin-left: 5px;"><a onclick="initData(0)" class="label label-success radius" >审核通过</a></li>
			<li style="float: left;margin-left: 5px;"><a onclick="initData(1)" class="label radius">待审核</a></li>
			<li style="float: left;margin-left: 5px;"><a onclick="initData(2)" class="label label-danger radius">未通过</a></li>
			<li style="float: left;margin-left: 5px;"><a onclick="initData(null)" class="label label-default radius">全部</a></li>
		</ul>
	</div>
    <span id="checkUserData">

	</span>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="<%=path%>/backstatic/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="<%=path%>/backstatic/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="<%=path%>/backstatic/h-ui.admin/js/H-ui.min.js"></script>
<script type="text/javascript" src="<%=path%>/backstatic/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="<%=path%>/backstatic/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path%>/backstatic/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<%=path%>/backstatic/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">


	$(function(){
		initData(null);//进入页面，显示全部审核状态的用户
	});

	function initData(n){
		$.get("<%=path%>/backstage/usertype/checkUserData",
		{userStates:n},
		 function (data) {
			 $("#checkUserData").html(data);
		 }
		)
	}
/*资讯-审核*/
function article_shenhe(obj,id){
	layer.confirm('审核认证？', {
				btn: ['通过','不通过','取消'],
				shade: false,
				closeBtn: 0
			},
			function(){
				var id = $(obj).parent().attr("id");
				$.get("<%=path%>/backstage/usertype/changeVipStatus",
						{id:id,flag:true},
				function () {
					$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_stop(this,id)" href="javascript:;" title="审核通过">取消通过</a>');
					$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已通过</span>');
					$(obj).remove();
					layer.msg('已通过', {icon:6,time:1000});
				})
			},

			function(){
				var id = $(obj).parent().attr("id");
				$.get("<%=path%>/backstage/usertype/changeVipStatus",
						{id:id,flag:false},
				function () {
					$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_start(this,id)" href="javascript:;" title="审核未通过">通过</a>');
					$(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">未通过</span>');
					$(obj).remove();
					layer.msg('未通过', {icon: 5, time: 1000});
				})
			});
}
/*资讯-下架*/
function article_stop(obj,id){
	layer.confirm('确认要取消通过吗？',function(index){
		var id = $(obj).parent().attr("id");
		$.get("<%=path%>/backstage/usertype/changeVipStatus",
				{id:id,flag:false},
				function () {
					$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_start(this,id)" href="javascript:;" title="审核未通过">通过</a>');
					$(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">已取消通过</span>');
					$(obj).remove();
					layer.msg('已取消通过', {icon: 5, time: 1000});
					//$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_start(this,id)" href="javascript:;" title="发布"><i class="Hui-iconfont">&#xe603;</i></a>');
					//$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已下架</span>');
					//$(obj).remove();
					//layer.msg('已下架!',{icon: 5,time:1000});
				})
	});
}

/*资讯-发布*/
function article_start(obj,id){
	layer.confirm('确认通过吗？',function(index){
		var id = $(obj).parent().attr("id");
		$.get("<%=path%>/backstage/usertype/changeVipStatus",
				{id:id,flag:true},
				function () {
					$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_stop(this,id)" href="javascript:;" title="审核通过">取消通过</a>');
					$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已通过</span>');
					$(obj).remove();
					layer.msg('已通过', {icon: 6, time: 1000});
					//$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_stop(this,id)" href="javascript:;" title="下架"><i class="Hui-iconfont">&#xe6de;</i></a>');
					//$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">确认通过</span>');
					//$(obj).remove();
					//layer.msg('已发布!',{icon: 6,time:1000});
				})
	});
}

</script>
</body>
</html>